package org.pine.controller;

import org.pine.jpa.dao.UserDao;
import org.pine.jpa.dao2.UserDao2;
import org.pine.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName UserController
 * @Description:TODO
 * @Author liucs
 * @Date 2021-01-28
 * @Version V1.0
 */
@RestController
public class UserController {
    UserDao userDao;
    @Autowired
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }
    UserDao2 userDao2;
    @Autowired
    public void setUserDao2(UserDao2 userDao2) {
        this.userDao2 = userDao2;
    }

    @GetMapping("/test1")
    public void test1() {
        User u1 = new User();
        u1.setAge(55);
        u1.setName("鲁迅");
        u1.setGender("男");
        userDao.save(u1);

        User u2 = new User();
        u2.setAge(80);
        u2.setName("泰戈尔");
        u2.setGender("男");
        userDao2.save(u2);
    }
}
